//
// Created by Administrator on 2024/10/25.
//

#ifndef AI_PACS_DOWNLOADER_H
#define AI_PACS_DOWNLOADER_H


#include "Coroutine.h"
#include <iostream>
#include <nlohmann/json.hpp>
#include <curl/curl.h>




class Downloader {
public:
    static size_t writeCallback(void* ptr, size_t size, size_t nmemb, std::ofstream* stream);
    static std::string curlTask(const std::string& url,const std::string& outputFile);
    static Promise<std::string> Gather(std::vector<std::string> urls,const std::string &file_prefix);
    static std::vector<std::string> Executor(std::vector<std::string> &urls,const std::string &file_prefix);
};

#endif //AI_PACS_DOWNLOADER_H
